package cn.wp.common.core;

import cn.hutool.core.date.DateUtil;
import org.springframework.http.ResponseEntity;

/**
 * 全局常量定义
 * Created by chenyb on 2019-09-24
 */
public interface WpVar {

    String ID = "id";
    String ENCODE = "UTF-8";
    String TREE_ROOT = "ROOT";
    String ADMIN = "admin";
    String GHOST = "ghost";
    String LOG_DTO_KEY = "LOG_DTO";
    // 超级token不进行拦截，同时也获取不到用户信息
    String SUPER_TOKEN_VALUE = "super:token:wealthypower2019";
    // 超级tokenId
    String SUPER_TOKEN_ID = "super:token:id";

    int YES_FOR_INT = 0;
    int NO_FOR_INT = 1;
    String YES = "Y";
    String NO = "N";

    // 成功响应码
    String SUCCESS_CODE = "000000";

    // 框架级默认级失败，后台抛异常等，其他业务级异常根据情况自定义即可
    String ERROR_CODE = "999999";

    // 未登录
    String NO_LOGIN_CODE = "999998";

    // token无效
    String TOKEN_INVALID_CODE = "999997";

    // 重复登录
    String REPEAT_LOGIN_CODE = "999996";

    // 系统提供的默认业务错误码
    String DEFAULT_FAILURE_CODE = "999995";

    String P_PAGE = "page";
    String P_LIMIT = "limit";

    String SKIP_INTERCEPTOR_ON_CLASS = "skip_interceptor_on_class";
    String SKIP_INTERCEPTOR_ON_METHOD = "skip_interceptor_on_method";
    String INTERCEPTORS = "interceptors";

    // token id值key
    String TOKEN_ID_KEY = "wp-token-id";

    // token 原始值key
    String TOKEN_VALUE_KEY = "wp-token-value";

    // 响应报文数据格式参数名
    String RESPONSE_BODY_TYPE = "wp_response_body_type";

    // JSON 报文格式
    String RESPONSE_JSON_BODY = "json";

    // 常规 报文格式，保持默认
    String RESPONSE_NORMAL_BODY = "normal";
}